<template>
  <div>
     <!-- <v-button v-for="item in arr" :key="item.id" @click="$router.push('/list?id='+item.id)">{{item.catename}}</v-button> -->
     <van-tabs @click="onClick">
  <van-tab v-for="item in arr" :key="item.id" :title="item.catename">
  </van-tab>
</van-tabs>
  </div>
</template>

<script>
import {reqhomecat} from "../../../http/http"
import axios from "axios"
export default {
  data(){
    return{
      //初始化数据
      arr:[]
    }
  },
    //发送请求
  mounted(){
        reqhomecat().then(res=>{
        console.log(res);
        this.arr = res.data.list
      })
  },
  methods:{
    onClick(index,title){
      this.$router.push("/list?id="+this.arr[index].id)
    }
  }

}
</script>

<style>

</style>